package cn.tedu.micro.device.service.impl;

import cn.tedu.micro.common.pojo.po.GunInfoPO;
import cn.tedu.micro.common.pojo.vo.GunInfoVO;
import cn.tedu.micro.device.repository.impl.GunRepositoryImpl;
import cn.tedu.micro.device.service.GunService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class GunServiceImpl implements GunService {
    @Autowired
    private GunRepositoryImpl gunRepository;

    @Override
    public GunInfoVO getGunInfo(Integer gunId) {
        log.info("开始处理查询充电枪信息业务，参数：{}", gunId);
        GunInfoPO infoPO = gunRepository.getGunInfo(gunId);
        GunInfoVO infoVO = new GunInfoVO();
        BeanUtils.copyProperties(infoPO, infoVO);
        return infoVO;
    }
}
